package coordenadas;

import java.io.IOException;
import java.util.logging.Logger;
import javax.jdo.PersistenceManager;
import javax.servlet.http.*;



public class SignPoisServlet extends HttpServlet {
    private static final Logger log = Logger.getLogger(SignPoisServlet.class.getName());

    public void doPost(HttpServletRequest req, HttpServletResponse resp)
                throws IOException {
        String latitude = req.getParameter("latitude");

        String longitude = req.getParameter("longitude");

        Pois coordenadas = new Pois(latitude, longitude);

        PersistenceManager pmPois = PMFpois.get().getPersistenceManager();
        try {
            pmPois.makePersistent(coordenadas);
        } finally {
            pmPois.close();
        }

        resp.sendRedirect("/listaPois.jsp");
    }
}
